package com.egao.common.module.credits.entity;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author lym
 * @date 2022/1/20 11:43
 */
@Data
@ApiModel(description = "项目学分")
@TableName("credits")
public class Credits implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "业务类型", notes = "1就业讲座 2校内宣讲会")
    private String type;

    @ApiModelProperty("业务ID")
    private Integer businessId;

    @ApiModelProperty("学分")
    private BigDecimal credits;

    @ApiModelProperty("业务标题")
    private String title;

    @ApiModelProperty("添加时间")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private Date createTime;

    @ApiModelProperty("是否删除 0否 1是")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "业务类型名称")
    @TableField(exist = false)
    private String typeName;

    public Credits() {}

    public Credits(String type, Integer businessId, String title, BigDecimal credits) {
        this.type = type;
        this.businessId = businessId;
        this.title = title;
        this.credits = credits;
    }

}
